<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>时间刷新</title>
</head>
<body>

</body>
<script>
    window.setInterval(function () {

        var now = new Date();

        var year=now.getFullYear();
        var m=(now.getMonth()+1);
        var d=now.getDate();
        var hour=now.getHours();
        var minute=now.getMinutes();
        var second=now.getSeconds();
        document.write(year+":"+m+":"+d+":"+hour+":"+minute+":"+second+"<br/>");
    },1000)


</script>
</html>